from selenium import webdriver
from time import sleep

# 声明浏览器
browser = webdriver.Chrome()


browser.implicitly_wait(5)

# 将浏览器最大化
browser.maximize_window()

# 访问兔展工作台
browser.get("https://www.rabbitpre.com/")

# 查找登录按钮,点击按钮
signin_btn = browser.find_element_by_css_selector("#g-j-signin-btn").click()
sleep(2)

# 查找对应元素
login_iframe = browser.find_element_by_css_selector('#sso')
browser.switch_to.frame(login_iframe)

account_button = browser.find_element_by_css_selector('span[data-type="tuzhan"]').click()
sleep(2)
username = browser.find_element_by_css_selector('[placeholder="请输入你的登录账户"]').send_keys("17825202051")
sleep(2)
password = browser.find_element_by_css_selector('[placeholder="请输入密码"]').send_keys("123456")
sleep(2)
login_button = browser.find_element_by_css_selector("button.g-btn.login-btn.do-btn").click()


sleep(2)
# 关闭浏览器
browser.quit()